<!--********************* Part1:Jsp Head *********************-->

<%@ page contentType="text/html;charset=UTF-8"%>  
<%@ include file="/framework/head.jsp"%>

<!--********************* Part2:Java Code *********************-->

<!--********************* Part3:JavaScript Code ***************-->
<!--start 客户端脚本区域-->
<script language=javascript>

<%
String msg = (String)session.getAttribute("MSG");
session.removeAttribute("MSG");
if(msg != null){
%>
    alert("<%=msg%>");
<%
}
%>

var list_code = "listReportMDWCMoneyInoutNew";

function process(val)
{
    SetValue("title","13");
    SetValue("warehouseCode",GetValue("i_WarehouseCode"));
    if(GetValue("i_WarehouseCode").length<= 4){
        alert("请指定一个仓库");
        return false;
    }
   
    if(val == '1'){
        SetValue("begindate",GetValue("i_Year"));
        SetValue("enddate",GetValue("i_Month"));
        SetValue("querytype","1");
    }else{
    
        if(GetValue("i_StartLastUpdate") == ""){
            alert("起始日期不可为空!");
            return false;
        }
	    var startHour=document.getElementById("startHour").selectedIndex;
		if(startHour <10){
		    startHour=" 0"+startHour+":00:00";
		}else{ 
		    startHour=" "+startHour+":00:00";   
		}    
		var endHour=(document.getElementById("endHour").selectedIndex);
		if(endHour <10){
		    endHour=" 0"+endHour+":59:59";
		}else{ 
		    endHour=" "+endHour+":59:59";  
		}
        SetValue("begindate",GetValue("i_StartLastUpdate")==""?"":GetValue("i_StartLastUpdate")+startHour);
        SetValue("enddate",GetValue("i_EndLastUpdate")==""?"":GetValue("i_EndLastUpdate")+endHour);
        SetValue("querytype","2");
        
    }
    SetValue("positionCode",GetValue("i_PositionCode"));
    SetValue("balanceMode",GetValue("i_BalanceMode"));
    frm.action = "<%=response.encodeURL(Config.getWebPath() + "/servlet/ReportServletHis") %>";
    frm.submit();
}
function process2(val)
{
    SetValue("title","17");
    SetValue("warehouseCode",GetValue("i_WarehouseCode"));
    if(GetValue("i_WarehouseCode") == "000000"){
        alert("请选择总库以外具体的仓库");
        return false;         
    }
    if(val == '1'){
        SetValue("begindate",GetValue("i_Year"));
        SetValue("enddate",GetValue("i_Month"));
        SetValue("querytype","1");
    }else{
        if(GetValue("i_StartLastUpdate") == ""){
            alert("起始日期不可为空!");
            return false;
        }
        var startHour=document.getElementById("startHour").selectedIndex;
		if(startHour <10){
		    startHour=" 0"+startHour+":00:00";
		}else{ 
		    startHour=" "+startHour+":00:00";   
		}    
		var endHour=(document.getElementById("endHour").selectedIndex);
		if(endHour <10){
		    endHour=" 0"+endHour+":59:59";
		}else{ 
		    endHour=" "+endHour+":59:59";  
		}
        SetValue("begindate",GetValue("i_StartLastUpdate")==""?"":GetValue("i_StartLastUpdate")+startHour);
        SetValue("enddate",GetValue("i_EndLastUpdate")==""?"":GetValue("i_EndLastUpdate")+endHour);
        SetValue("querytype","2");
    }
    SetValue("positionCode",GetValue("i_PositionCode"));
    SetValue("balanceMode",GetValue("i_BalanceMode"));
    frm.action = "<%=response.encodeURL(Config.getWebPath() + "/servlet/ReportServlet") %>";
    frm.submit();
}
</script>


<%=uiBody%>>

<!--********************* Part4:Form  ***************-->
<form id=frm action="<%=Config.getSrv()%>" method="post">
<input type=hidden name="warehouseCode" value="">
<input type='hidden' name='begindate' value="">
<input type='hidden' name='enddate' value="">
<input type='hidden' name='querytype' value="">
<input type='hidden' name='title' value="">
<input type=hidden name='positionCode' value=""> <!--选择的货位code-->
<input type=hidden name='balanceMode' value=""> <!--结算模式-->

<!--查询条件保留区域-->


<br>
<!--********************* Part5:Search Area ***************-->
<%=uiSearchStart%>>
<%
    int key_tab = 1 ;
%>

<table id=listTable cellpadding='1' cellspacing='1' width='100%' class='data_line'><thead class='data_th'>

<tr align='center' height='24'>

    <td colspan = "2">产品资金进出累计汇总分类统计</td></tr>

    
<tbody class='data_tb'>
    <tr height="24"  bgcolor="#EBEEF3">
        <td colspan = "2">
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;仓库选择：
        <%=SelectManager.viewWarehouseSelect(con,loginInfo.getLoginWarehouseCode(),"i_WarehouseCode","",false,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%>
         &nbsp;&nbsp;&nbsp;&nbsp;仓库货位：
       <%=SelectManager.viewPosition(con,loginInfo.getLoginWarehouseCode(),"i_PositionCode","",false,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++),new String[]{loginInfo.getLoginWarehouseCode()})%>
         &nbsp;&nbsp;&nbsp;&nbsp;结算模式：
        <%=SelectManager.viewYKorMD("i_BalanceMode","1",true,"",SelectManager.SELECT_ALL,"","key_tab="+(key_tab++))%>
        
        </td>

    </tr>

    <tr height="24"  bgcolor="#FFFFFF">

        <td >&nbsp;选择结算月份：<%=SelectManager.viewYearSelectHis(con,"i_Year","2008",false,"","-请选择-","","")%>  <%=SelectManager.viewMonthSelect(con,"i_Month","01",false,"","-请选择-","","")%></td>

        <td >
            <input type="button" name="button2" class='buttons' value="导出仓库分类统计报表" onclick='process(1)'>
            <input type="button" name="button3" class='buttons' value="导出集团分类统计报表" onclick='process2(1)'>
        </td>
    </tr>

    <tr height="24"  bgcolor="#EBEEF3">

    
        <td >&nbsp;&nbsp;&nbsp;选择时间段：<%=framework.custom.UIManager.generateDateInputHis("i_StartLastUpdate", "")%>
        &nbsp;<select id="startHour" >
              <%for(int i=0;i<24;i++){ %>
                <option><%=i %></option>
                <%} %>
              </select>
        	 至 
       	&nbsp;
        	 <%=framework.custom.UIManager.generateDateInputHis("i_EndLastUpdate", "")%>
        &nbsp;	<select id="endHour">
                <option>1</option>
                <option>2</option>
                <option>3</option>
                <option>4</option>
                <option>5</option>
                <option>6</option>
                <option>7</option>
                <option>8</option>
                <option>9</option>
                <option>10</option>
                <option>11</option>
                <option>12</option>
                <option>13</option>
                <option>14</option>
                <option>15</option>
                <option>16</option>
                <option>17</option>
                <option>18</option>
                <option>19</option>
                <option>20</option>
                <option>21</option>
                <option>22</option>
                <option>23</option>
                <option selected="selected">24</option>
              </select> 	 
       	</td>
    	
        <td >
            <input type="button" name="button4" class='buttons' value="导出仓库分类统计报表" onclick='process(2)'>
            <input type="button" name="button5" class='buttons' value="导出集团分类统计报表" onclick='process2(2)'>
        </td>
    </tr>
</tbody>

</table>


<%=uiSearchEnd%>

</form>


<%@ include file="/framework/foot.jsp"%>
